Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
"Expected an arrow function after this type parameter declaration" error

I got this error while running yarn start:

$ yarn start
yarn run v1.22.17
$ run-s build exec
$ babel src/ -d lib/
SyntaxError: .../src/App.js: Expected an arrow function after this type parameter declaration. (8:9)

   6 |
   7 | export default function App(): React$MixedElement {
>  8 |   return <p>Hello, React!</p>;
     |          ^
   9 | }
  10 |

Below are the configs:

package.json

"scripts": {
    "flow": "flow",
    "start": "run-s build exec",
    "exec": "node lib/index.js",
    "build": "babel src/ -d lib/",
},

babel.config.json:

{
  "presets": ["@babel/preset-flow"],
  "plugins": ["babel-plugin-transform-flow-enums"],
  "targets": {
    "esmodules": true
  }
}

App.js:

// @flow

import "./App.css";

import React from "react";

export default function App(): React$MixedElement {
  return <p>Hello, React!</p>;
}

What the issue with my configs and react file?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It seems to be a typo on React.MixedElement, replace the $ by a .:

export default function App(): React.MixedElement {...}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda